package com.fulu.javabase.memberlocalvar;

/**
 * 成员变量和局部变量
 */
public class MemberLocalVarTest {
    static int s;
    int i;
    int j;
    {
        int i = 1;
        i++;
        j++;
        s++;
    }

    public void test(int j){
        j++;
        i++;
        s++;
    }

    public static void main(String[] args) {
        MemberLocalVarTest ml1 = new MemberLocalVarTest();
        MemberLocalVarTest ml2 = new MemberLocalVarTest();
        ml1.test(10);
        ml1.test(20);
        ml2.test(30);
        System.out.println(String.format("%d,%d,%d", ml1.i, ml1.j, ml1.s));
        System.out.println(String.format("%d,%d,%d", ml2.i, ml2.j, ml2.s));
    }
}
